﻿using System.Reflection;

namespace Com.Lancetinc.Evs.Data.Domain
{
    /// <summary>
    /// 实验信息
    /// </summary>
    [Obfuscation(Exclude = true)]
    public class Exper
    {
        public Exper()
        {
            SetDefaults();
        }

        /// <summary>
        /// 流水号
        /// </summary>
        public string SeqNo { get; set; }

        /// <summary>
        /// 病历号
        /// </summary>
        public string MedicalRecordNo { get; set; }

        /// <summary>
        /// 床位号
        /// </summary>
        public string BedNo { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 性别。1=男，0=女
        /// </summary>
        public string Sex { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }

        /// <summary>
        /// 主治医师
        /// </summary>
        public string AttendingDoctor { get; set; }

        /// <summary>
        /// 助理医师
        /// </summary>
        public string Mediastinus { get; set; }

        /// <summary>
        /// 诊断
        /// </summary>
        public string Diagnosis { get; set; }

        /// <summary>
        /// 身份证
        /// </summary>
        public string Identity { get; set; }

        /// <summary>
        /// 检查部位
        /// </summary>
        public string InspectionPosition { get; set; }

        /// <summary>
        /// 打印次数
        /// </summary>
        public int PrintCount { get; set; }

        /// <summary>
        /// 上次打印时间
        /// </summary>
        public string LastPrintTime { get; set; }

        /// <summary>
        /// 报告图片
        /// </summary>
        public string ReportImages { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Notes { get; set; }

        /// <summary>
        /// 录像开始时间
        /// </summary>
        public string StartTime { get; set; }

        /// <summary>
        /// 录像结束时间
        /// </summary>
        public string EndTime { get; set; }

        /// <summary>
        /// 锁定？
        /// </summary>
        public bool Locked { get; set; }

        /// <summary>
        /// 视频旋转角度
        /// </summary>
        public short VideoRotationAngle { get; set; }

        /// <summary>
        /// 视频宽度
        /// </summary>
        public short VideoWidth { get; set; }

        /// <summary>
        /// 视频高度
        /// </summary>
        public short VideoHeight { get; set; }

        /// <summary>
        /// 播放时间（单位毫秒）
        /// </summary>
        public long MediaDuration { get; set; }

        /// <summary>
        /// 内窥镜序号
        /// </summary>
        public string HcSerialNo { get; set; }

        /// <summary>
        /// 是否水平翻转
        /// 1:翻转
        /// </summary>
        public int FlipHorizontally { get; set; }

        /// <summary>
        /// 是否垂直翻转
        /// 1:翻转
        /// </summary>
        public int FlipVertically { get; set; }

        private void SetDefaults()
        {
            Locked = false;
            Age = 20;
            Sex = "1";
            VideoRotationAngle = 0;
            VideoWidth = 400;
            VideoHeight = 400;
            MediaDuration = 0;
            FlipHorizontally = 0;
            FlipVertically = 0;
        }

        public void Reset()
        {
            foreach (var prop in GetType().GetProperties())
            {
                prop.SetValue(this, null);
            }

            SetDefaults();
        }
    }
}